Platform Explorer / Nuxeo Platform 5.8

Component org.nuxeo.ecm.rating.gadgets

Contributions

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.rating.gadgets" version="1.0">

  <extension target="org.nuxeo.opensocial.gadgets.service" point="gadget">

    <internalGadget name="mostLiked" disabled="false">
      <documentation>
        This gadget allows user to list most liked document from a Social Workspace or from a SuperSpace if it is added in the User Home.
        It's possible to display most liked documents from a range of date:
        - this week
        - this month
        - last week
        - last month
        - ever

        The following user preferences can be used to configure it:
        - contextPath: stores the last selected SuperSpace in case that the gadget is not in a Social Workspace (targetContextPath empty.)
        - dateRange: default dateRange selected, possible value: ever, this_week, this_month, last_week, last_month. Ever is the default one.

        How to include mostLiked gadget in a JSF context:
        <code>
          <div class="gadget-mostLiked threeQuarterWidth"></div>
          <script type="text/javascript">
            jQuery('.gadget-mostLiked').openSocialGadget({
              baseURL: '#{baseURL}',
              language: '#{localeSelector.language}',
              gadgetDefs: [
                { specUrl: '#{gadgetsBaseURL}/site/gadgets/mostLiked/mostLiked.xml',
                  title: 'My most liked document',
                  userPrefs: {
                    contextPath: {
                      value: '/default-domain/'
                    },
                    dateRange: {
                      value: 'last_week'
                    }
                  },
                  displayTitleBar: false,
                  width: '100%'
                }
              ]
            });
          </script>
        </code>

        How to include the wall gadget in a WebEngine page:
        <code>
          <link rel="stylesheet" href="${contextPath}/css/opensocial/light-container-gadgets.css" />
          <script type="text/javascript" src="${contextPath}/opensocial/gadgets/js/rpc.js?c=1"></script>
          <script type="text/javascript" src="${contextPath}/js/?scripts=jquery.js|opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js"></script>

          <div class="gadget-mostLiked gadgets-gadget-chrome"></div>
          <script type="text/javascript">
            $('.gadget-mostLiked').openSocialGadget({
              baseURL: '${contextPath}' + '/',
              language: '${Context.locale.language}',
              gadgetDefs: [{
                specUrl : '${Runtime.getProperty('nuxeo.loopback.url')}/site/gadgets/mostLiked/mostLiked.xml',
                userPrefs: {
                  contextPath: {
                    value: '/default-domain/'
                  },
                  dateRange: {
                    value: 'last_week'
                  }
                },
                displayTitleBar: false,
                width: '100%'
              }]
            });
          </script>
        </code>
      </documentation>
      <mountPoint>/mostLiked</mountPoint>
      <entryPoint>mostLiked.xml</entryPoint>
      <category>Nuxeo</category>
      <icon>gadget-mostLiked.png</icon>
    </internalGadget>

  </extension>

</component>